Skip to content

Conversation

JustForFun88
Copy link
Contributor

This PR is similar to #348, but we are considering panic during table dropping. If the element from the dropping table panics from its Drop impl, the table will not be deallocated, leading to a memory leak. This pull request fixes that.

@JustForFun88
Copy link
Contributor Author

Looks like fail caused by rust-lang/rust#101474 as mentioned in #359

@Amanieu
Copy link
Member

Amanieu commented Sep 7, 2022

I'm concerned that this increases code size (and thus compilation time) for little benefit: a panic in a Drop usually means that you're going to leak memory anyways. IMO the proper solution is to completely disallow unwinding from Drop (rust-lang/rfcs#3288).

@JustForFun88
Copy link
Contributor Author

I'm concerned that this increases code size (and thus compilation time) for little benefit: a panic in a Drop usually means that you're going to leak memory anyways. IMO the proper solution is to completely disallow unwinding from Drop (rust-lang/rfcs#3288).

Hmm... yes, I think you're right. Complications do not bring any benefit. Closing this pull request.

@JustForFun88 JustForFun88 deleted the fix_leaking branch September 7, 2022 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants